package io.jaegertracing.internal.reporters;

import io.jaegertracing.internal.JaegerSpan;
import io.jaegertracing.spi.Reporter;
import lombok.ToString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author qiaodong
 * @since 2020-10-13
 * 覆盖jar包中LoggingReporter类
 */
@ToString
public class LoggingReporter implements Reporter {
    private final Logger logger;

    public LoggingReporter() {
        this(null);
    }

    public LoggingReporter(Logger logger) {
        if (logger == null) {
            logger = LoggerFactory.getLogger(this.getClass());
        }
        this.logger = logger;
    }

    @Override
    public void report(JaegerSpan span) {
        //logger.info("Span reported: {}", span);
    }

    @Override
    public void close() {
        // nothing to do
    }
}
